Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrPhieuKiemKeThanhPham
    Private data As DataTable
    Private thang, nam, kho As String
    Private tiendauky As Double
    Private customerReport As ReportDocument
    Private Sub FrmCrNXTTongHopLo_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sqlQuery As String = "SELECT t1.ma_hanghoa,t1.ten_bietduoc,t1.solo,t1.handung,t1.soluongcuoiky,t2.donvi_thung,t2.quicach_thung,t2.donvi_banchan,t2.quicach_banchan,t2.donvi_banle,t2.quicach_banle FROM tbl_dot_NhapXuatTongHop_Lo as t1 LEFT JOIN tbl_hanghoa as t2 ON t1.ma_hanghoa=t2.ma_hanghoa where recycleId='" & nam & thang & "' AND t1.soluongcuoiky<>0  order By ten_bietduoc"
        Dim reportPath = Application.StartupPath & "\" & "crPhieuKiemKeThanhPham.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("month", thang)
        customerReport.SetParameterValue("year", nam)
        customerReport.SetParameterValue("TKho", kho)
        Me.CrNXTTongHopview.ReportSource = customerReport
    End Sub
    Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Close()
    End Sub
    Public Sub setThang(ByVal s As String)
        thang = s
    End Sub
    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
    Public Sub setKho(ByVal s As String)
        kho = s
    End Sub
    Public Sub setData(ByVal d As DataTable)
        data = d
    End Sub
End Class
